package com.pzr.soccer.domain;

public enum RoleType {

	DBAdmin("DBAdmin","数据库管理员",90),Admin("Admin","管理员",80),SuperVip("SuperVip","白金会员",70),Vip("Vip","黄金会员",60),Normal("Normal","会员",50),Guest("Guest","游客",40);
	
	public final String name;
	public final String nameZh;
	public final int code;
	private RoleType(String name,String nameZh,int code) {
		this.name=name;
		this.nameZh=nameZh;
		this.code=code;
	}
	
	public static RoleType instance(String name) {

       for(RoleType type:RoleType.values()) {
    	   if(name.equals(type.name)) {
    		   return type;
    	   }
       }
		return null;
	}
	
	public static int getCode(String name) {

	       for(RoleType type:RoleType.values()) {
	    	   if(name.equals(type.name)) {
	    		   return type.code;
	    	   }
	       }
			return 0;
		}
}
